﻿/*AJAX*/
function createXMLHttpRequest() {
    if(window.ActiveXObject   &&   !window.XMLHttpRequest)   
      {   
          window.XMLHttpRequest   =   function()   
          {   
              var   msxmls=['MSXML3','MSXML2','Microsoft'],   ex;   
              for(var   i=0;i<msxmls.length;i++)   
                  try{return   new   ActiveXObject(msxmls[i]+'.XMLHTTP')}   catch(ex){}   
                  throw   new   Error("No   XML   component   installed!");   
          }   
      }   
      var   request  =  new   XMLHttpRequest();   //注意大小写
      return request;
};
function getAjax(xmlHttp,url,respVar){
    if(xmlHttp!=undefined){
        xmlHttp.open("get",url);
        xmlHttp.onreadystatechange = function(){handleStateChange(xmlHttp,respVar);};
        xmlHttp.send(null);
    }
};
function handleStateChange(xmlHttp,respVar){
    if(xmlHttp.readyState ==4){
        if(respVar!=undefined){
             respVar(xmlHttp.responseText);
         }   
    }
};
